package com.ztools.wx.controller;

import com.ztools.common.model.pc.store.OnlineStock;
import com.ztools.common.model.pc.store.StoreSale;
import com.ztools.common.util.common.Result;
import com.ztools.wx.service.WxStoreService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: seeTools
 * @Date: 2023/5/30  14:44
 * @Version 1.0
 */
@RestController
@RequestMapping("/wx/store")
public class WxStoreController {

    @Resource
    private WxStoreService wxStoreService;

    @RequestMapping("/getStoreMall")
    public Result getStoreMall() {
        List<OnlineStock> onlineStockList = wxStoreService.getStoreMall();
        return Result.success().data(onlineStockList);
    }

    @RequestMapping("/getStoreSale/{memberId}")
    public Result getStoreSale(@PathVariable("memberId") Long memberId) {
        List<StoreSale> storeSaleList = wxStoreService.getStoreSale(memberId);
        return Result.success().data(storeSaleList);
    }

}
